//
//  HGUser.m
//  HGMM
//
//  Created by 2008-bj5 on 15/8/4.
//  Copyright (c) 2015年 cc. All rights reserved.
//

#import "HGUser.h"
//#import "HGRequestUtil.h"
#import "DataSave.h"

@implementation HGUser



- (void)getUserInfo:(CDVInvokedUrlCommand*)command{
    CCLog(@"HGUser - getUserInfo");
    
    UserModel *model = [[DataSave shareInstance] getUserInfo];
    
    NSDictionary *user = [NSDictionary dictionaryWithObjectsAndKeys:model.guid,@"guid", model.usercoder,@"usercode", model.username,@"username", model.dept,@"dept",nil];
    
    CDVPluginResult* pluginResult = nil;
    
    pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:user];
    
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
    
}

-(NSString *)eMailFormatWithHgflag:(NSString *)flag{
    
    NSArray *sepArray = [flag componentsSeparatedByString:@"\\"];
    NSString *hg1 = sepArray[0];
    NSString *hg2 = sepArray[1];
    NSString *result = [NSString stringWithFormat:@"%@@%@.intra.customs.gov.cn",hg2,hg1];
    
    return result;
    
}



@end
